import Vue from 'vue'
import App from './App.vue'
import router from '@/router'
import store from '@/store'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI, {
  size: 'small'
});

//主css
import '@/assets/css/index.scss';

//svg文件夹
import '@/assets/icons'
//引入阿里巴巴矢量图
import '@/assets/Alibaba-Icon/iconfont.css'

//注册全局组件
import '@/assets/utils/signinComponents';


//加载路由守卫
import '@/assets/utils/routerGuard'

import CodeEditor from 'bin-code-editor';
Vue.use(CodeEditor);

//公用类
import Utils from "@/assets/utils/utils";
Vue.prototype.Utils = Utils;

//福建省地址
import Address from "@/assets/utils/address";
Vue.prototype.Address = Address;

//代码生成组件公用方法
import HandleUtils from "@/assets/utils/handleUtils";

Vue.prototype.HandleUtils = HandleUtils;

//阻止多次弹窗
import {message} from '@/assets/js/resetMessage';

//api挂载全局，统一调用
import allApi from "@/api/index";

allApi.keys().map(item => {
    Object.keys(allApi(item)).forEach(key => {
        Vue.prototype["$" + key] = allApi(item)[key];
    })
})


//element 默认配置
Vue.prototype.$ELEMENT = {
    size: 'small',
}

//e-icon-picker 配置 下拉选择element图标
import eIconPicker from 'e-icon-picker';

Vue.use(eIconPicker, {
    FontAwesome: false,
    ElementUI: true,
    eIcon: false,//自带的图标，来自阿里妈妈
    eIconSymbol: false,//是否开启彩色图标
    addIconList: [],
    removeIconList: [],
    zIndex: 3100//选择器弹层的最低层,全局配置
});

//阻止多次弹窗 调用
Vue.prototype.$message = message;

//阻止显示生产模式的消息
Vue.config.productionTip = false

//清除缓存
const VUE_APP_VERSION = require('../package.json').version
const vers = window.localStorage.getItem("appVersion");
if(VUE_APP_VERSION != vers){
    localStorage.clear()
    window.localStorage.setItem("appVersion", VUE_APP_VERSION);
    location.reload()
}

new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')
